'use strict';
// 创建db对象
const db = uniCloud.database();
// 获取 `tt_menus` 集合的引用
const menuCollection = db.collection('tt_menus');
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let {
		name
	} = event;
	if (name) {
		const result = await menuCollection.where({
			name: name
		}).get()
		return result;
	} else {
		return {
			msg: "缺少参数"
		}
	}

};